package me.wangxuan.pat.generator;

import java.util.ArrayList;
import java.util.List;

public class GeneratorFactory {

	private static List<IGenerator> generators = new ArrayList<>();
	
	static {
		generators.add(new TimeStampGenerator());
		generators.add(new IdCardGenerator());
	}

	public static IGenerator createGenerator(GeneratorType type) {
		return generators.stream().filter(g -> g.getType() == type).findFirst().orElse(null);
	}
}
